import React, { useState } from "react";
function Room(props) {
	// let [count, setCount] = useState(true);
	let [on, setOn] = useState(false);
	return (
		// <div>
		//   {count ? "开" : "关"}
		//   <button
		//     onClick={() => {
		//       setCount(!count);
		//     }}
		//   >
		//     电源开关
		//   </button>
		// </div>
		<div>
			<h2>{on ? "房间被照亮" : "房间灯熄了"}</h2>
			<button onClick={() => setOn(!on)}>{on ? "on" : "off"}</button>
		</div>
	);
}
export default Room;
